<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件</title>

    <script>
        function myClick() {
            // alert("p也被调用")
            console.log("p也单击")
        }

        function mydbclick() {
            console.log("p被双击")
        }

        function mymove() {
            var p = document.getElementsByTagName("p")[0]
            p.style.backgroundColor = "read"
        }

        function myout() {
            var p = document.getElementsByTagName("p")[0]
            p.style.backgroundColor = "blue"
        }

        function mykeydown() {
            console.log("按下了......")
        }
    </script>

</head>
<body>

<p onclick="myClick()"
   ondblclick="mydbclick()"
    onmousemove="mymove()"
    onmouseout="myout()"
    onkeydown="mykeydown()">这是一个段落</p>

<input type="text" onkeydown="mykeydown()">

</body>
</html>